// pages/mine/addressEdit/addressEdit.js
import Common from '../../../common/common.js'
const common = new Common();

Page({
  data: {
    type: 0,
    lastInfo: {},//上一次的地址数据
    loadState: false, //可以保存
    addressRoot: false,
    address: {
      name: "", //姓名
      position: "", //定位地址，
      address: "", //详细地址
      tel: "", //电话
      longitude: "", //经度
      latitude: "", //纬度
    },
    pageId: "",
    region: ["北京市", "北京市", "全部"],
  },
  onLoad: function (options) {
    this.setData({
      winUuid: options.winUuid
    })
    this.getPageInfo();
  },
  onShow: function () {},
  //查询地址信息
  getPageInfo() {
    let data = {
      winId: this.data.winUuid
    }
    common.requestAjax('/api/promotion-service/v1/winningRecord/queryAddressByWinId', 'GET', data).then(res => {
      if (res.data.code) {
        this.setData({
          address: res.data.result
        })
      }
    }).catch(err => {

    })
  }
})